/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.edu.zjut.ces.service.impl;

import cn.edu.zjut.ces.dao.DaoTest;
import cn.edu.zjut.ces.dao.impl.DaoFactory;
import cn.edu.zjut.ces.domain.Mytest;
import cn.edu.zjut.ces.service.ServiceTest;
import javax.persistence.EntityManager;

/**
 *
 * @author user
 */
public class ServiceTestImpl extends BaseService implements ServiceTest{
    private DaoTest daoTest;

    public ServiceTestImpl(){
        EntityManager entityManager = this.getEntityManager();
        daoTest = DaoFactory.getDaoTest(entityManager);
    }

    public void setDaoTest(DaoTest daoTest){
        this.daoTest = daoTest;
    }

    public void add(Mytest mytest){
        this.startTransaction();
        daoTest.add(mytest);
        this.commitTransaction();
    }

}
